package xyf.p11.other;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * ClassName: M1611_DivingBoard
 * Description:
 * Author: xyf
 * Date: 9/16/22 10:19 PM
 * Version: 1.0
 **/
public class M1611_DivingBoard
{
    public int[] divingBoard(int shorter, int longer, int k)
    {
        Set<Integer> res = new HashSet<>();
        for (int i = 0; i <= k; i++)
        {
            int shortNum = i;
            int longerNum = k - i;
            int sum = shortNum * shorter + longerNum * longer;
            res.add(sum);
        }

        return res.stream().mapToInt(Integer::intValue).sorted().toArray();
    }
}